
import request from "@/utils/request1"

export function getConfigKey(key: string) {
    return request({
      url: '/system/config/configKey/' + key,
      method: 'get'
    })
}

//跟据code获取OpenId
export function getOpenIdByCode(data: any) {
    return request({
      url: `/system/user/getOpenIdByCode?code=${data.code}`,
      method: 'post',
      data:{}
    })
  }

// 跟据code获取绑定的员工用户列表
export function getStaffUsersList(data: any) {
    return request({
        url: `/system/user/getStaffUserListByCode?code=${data.code}`,
        method: 'post'
    })
}

//跟据openid获取绑定的员工用户列表
export function getStaffUsersListByOpenId(data: any) {
    return request({
        url: `/system/user/getStaffUserListByOpenId?openId=${data.openId}`,
        method: 'post'
    })
}

//跟据openId获取绑定的客户/员工用户列表
export function getUsersByOpenId(data: any) {
    return request({
      url: `/system/user/getUsersByOpenId?openId=${data.openId}`,
      method: 'post',
      data:{}
    })
  }
  
// 登录方法
export function h5login(data: any) {
    return request({
      url: '/auth/h5login',
      method: 'post',
      data: data
    })
}
// 登录方法
export function login(data: any) {
    return request({
        url: '/auth/login',
        method: 'post',
        data: { username: data.userName, password: data.password, code: "", uuid: "" }
    })
}

// 获取用户详细信息
export function systemUserGetInfo() {
    return request({
        url: '/system/user/getInfo',
        method: 'get'
    })
}